<#import "../macro/components.ftl" as components/>
<#include "../macro/layout_default.ftl"/>

<@head>
<link rel="stylesheet" href="/misc/app/css/product_list.css"/>
<link href="/misc/adminlte-2.3.7/plugins/twitter-bootstrap-v2/docs/assets/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="/misc/adminlte-2.3.7/plugins/daterangepicker/daterangepicker.css"/>
</@head>

<@body>
<script src="/misc/app/js/qrcode_auto_product_list.js"></script>
<script src="/misc/adminlte-2.3.7/plugins/daterangepicker/moment.min.js"></script>
<script src="/misc/adminlte-2.3.7/plugins/daterangepicker/daterangepicker.js"></script>
<script src="/misc/adminlte-2.3.7/plugins/twitter-bootstrap-v2/docs/assets/js/browser.js"></script>
<script src="/misc/adminlte-2.3.7/plugins/twitter-bootstrap-v2/docs/assets/js/bootstrap-typeahead.js"></script>
</@body>

<@layout_default>
<div class="box">
    <div class="box-header with-border">
        <span class="pull-right text-muted">共 ${pagelist.resultTotal} 条记录</span>
        <input type="hidden" id="resultTotal_hidden" value=" ${pagelist.resultTotal}" />
        <form class="form-inline" action="/qrcodeautoproduct">
             <div class="input-group">
                <div class="input-group-addon">生产单据号:</div>
                <input type="text" class="form-control" style="width: 260px" name="prodBillcode" value="${prodBillcode!}" 
                placeholder="生产单据号" autocomplete="off"/>
            </div>
            <div class="input-group">
                <div class="input-group-addon">产品名称:</div>
                <input type="text" class="form-control" style="width: 260px" name="proName" value="${proName!}" 
                placeholder="产品名称或者产品编码" autocomplete="off"/>
            </div>
            <div class="input-group">
                <div class="input-group-addon">灌装厂编号:</div>
                <input type="text" class="form-control" style="width: 260px" name="fillingplantcode" value="${fillingplantcode!}" 
                placeholder="灌装厂编号" autocomplete="off"/>
            </div>
			&nbsp; &nbsp; &nbsp;	
            <button type="submit" class="btn btn-warning"><i class="fa fa-search"></i> 查询</button>&nbsp; &nbsp; &nbsp;
        </form>
        <form class="form-inline hide">
            <input class="form-control"/>
            <input type="email" class="form-control"/>
            <button type="submit" class="btn btn-default">Send invitation</button>
        </form>
    </div>

    <!-- /.box-header -->
    <div class="box-body">
        <table class="table table-striped table-hover">
            <tr>
                <th>生产单据号</th>
                <th>产品</th>
                <th>产品编码</th>
                <th>箱数</th>
                <th>是否营销</th>
                <th>生产时间</th>
                <th>灌装厂编码</th>
                <th>操作</th>
            </tr>
            <#list pagelist.result as item>
                <tr >
                    <td style="vertical-align:middle;">${item.prodBillcode!}</td>
                   	<td style="vertical-align:middle;">${item.proname!}</td>
                    <td style="vertical-align:middle;">${item.procode!}</td>
                    <td style="vertical-align:middle;">${item.billnumber}</td>
                    <td style="vertical-align:middle;">
	                    <#if item.is_act=1>
		                    	<span class="text-green">是</span>
                                <!-- <button type="button" class="btn btn-default btn-xs" name="btn_is_act"  data-id="${item.proproductqrcodeId!}"  data-type="0" data-prodbillcode="${item.prodBillcode}" >停用营销</button> -->
	                     <#elseif item.is_act==0>
		                    	<span class="text-yellow">否</span>
		                   	    <button type="button" class="btn btn-default btn-xs" name="btn_is_act"  data-id="${item.prod_date}"  data-type="1" data-prodbillcode="${item.prodBillcode}">启用营销</button>
                         <#else>
	                    	    <span class="text-danger">未知</span>
	                    </#if>
                    </td>
                    <td style="vertical-align:middle;">${item.prod_date}</td>
                    <td style="vertical-align:middle;">${item.prod_fillingplantcode}</td>
                    <td style="vertical-align:middle;">
                      <button type="button" class="btn btn-default btn-xs" name="see_detail" onclick="window.location.href='/qrcodeautoproduct/detail?prodBillcode=${item.prodBillcode}'">明细</button>
                    </td>
                </tr>
            </#list>
        </table>
        <table class="table table-striped table-hover">
        	<tr>
        		<td colspan="13" style="text-align:right;background-color:white;">
        			<a href="javascript:void(0);" name="btn_qrcodeproduct_export"><i class="glyphicon glyphicon-save"></i> 数据导出</a>
        		</td>
        	</tr>
        </table>
    </div>
    <!-- /.box-body -->
    <div class="box-footer text-center">
       <@components.pagination "${pagelist.rquesturl}&page=$page",pagelist.page,pagelist.pageTotal/>
    </div>
</div>

</@layout_default>